//
//  OAAuthTokenRequest.m
//  OANetworkManager_Example
//
//  Created by TFAppleWork-Summer on 2018/2/8.
//  Copyright © 2018年 GuoRui. All rights reserved.
//

#import "OAAuthTokenRequest.h"

@interface OAAuthTokenRequest()
@end

@implementation OAAuthTokenRequest

- (instancetype)init {
    self = [super init];
    if (self) {
        // 鉴权的基地址
        self.baseURL = @"http://192.168.0.7:8080/";
        self.requestSerializerType = TFRequestSerializerTypeJSON;
        self.acceptableContentTypesSet = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/plain",nil];
        self.requestHeaders = @{ @"DEBUG" : @"1" };
        self.responseSerializerType = TFResponseSerializerTypeJSON;
       
    }
    return self;
}

-(id)params{
    NSString *userId = [[[NSUserDefaults standardUserDefaults] objectForKey:OANETWORKMANAGERUSER_KEY] objectForKey:@"userId"];
    NSString *loginName = [[[NSUserDefaults standardUserDefaults] objectForKey:OANETWORKMANAGERUSER_KEY] objectForKey:@"loginName"];
    return  @{@"loginName":loginName,
              @"userId":@([userId integerValue])
              };
}

-(NSString *)path{
    return @"oaAuth/getToken";
}
@end
